package cn.chencq.moudle.lottery.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import cn.chencq.moudle.lottery.entity.Lottery;
import cn.chencq.moudle.sys.dao.BaseDao;

@Mapper
public interface LotteryDao extends BaseDao<Lottery> {

	/**
	 * 
	 * @Title: batchSaveOrUpdate
	 * @Description: 批量更新或插入
	 * @param list
	 */
	void batchSaveOrUpdate(List<Lottery> list);

	/**
	 * 
	 * @Title: getMaxLotteryId
	 * @Description: 获取最近一期的期次号
	 * @param lotteryType
	 * @param date
	 * @return String
	 */
	String getMaxLotteryId(@Param("lotteryType") String lotteryType, @Param("date") String date);

	/***
	 * 查询某一期之后的开奖结果
	 * 
	 * @param lotteryId
	 * @param lotteryType
	 * @return
	 */
	List<Lottery> queryHigherLotteryId(@Param("lotteryId") String lotteryId, @Param("lotteryType") String lotteryType);

	/**
	 * 
	 * @Title: queryByDate
	 * @Description: 按时间查询开奖数据
	 * @param lotteryDate
	 * @param lotteryType
	 * @return List<Lottery>
	 */
	List<Lottery> queryByDate(@Param("lotteryDate") String lotteryDate, @Param("lotteryType") String lotteryType);

	/**
	 * @Title: queryLessLotteryId
	 * @Description: 查询某一期之前的开奖结果
	 * @param lotteryId
	 * @param lotteryType
	 * @return List<Lottery>
	 */
	List<Lottery> queryLessLotteryId(@Param("lotteryId") String lotteryId, @Param("lotteryType") String lotteryType);

	
	List<Lottery> queryLastTen(@Param("lotteryDate") String lotteryDate, @Param("lotteryType") String lotteryType);
}
